package com.service;

import com.Dao.SensitiveDao;

import java.sql.SQLException;
import java.util.Set;

public class SensitiveService {
    SensitiveDao dao=new SensitiveDao();

    public Set getAllSensitive() throws SQLException {
        return dao.getAllSensitive();
    }

    public void addSensitive(String word){
        try {
            dao.addSensitive(word);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            System.out.println("敏感词添加失败！！！");
        }
    }

    public void deleteSensitive(int id){
        try {
            dao.deleteSensitive(id);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            System.out.println("删除敏感词失败！！！");
        }
    }
}
